import { ApiCall } from "tsrpc";
import { ReqRandom_BodyStyle, ResRandom_BodyStyle } from "../../../../shared/master/bag/function/PtlRandom_BodyStyle";
import god from "../../../../god";
import { player } from "../../../../model/fight/body/player";
import { template } from "../../../../shared/master/MsgAction";

export default async function (call: ApiCall<ReqRandom_BodyStyle, ResRandom_BodyStyle>) {
    call.succ({})
    
    let user = call.req._player as player;
    let res = user.check_wallet(0, 0, [{ id: 'prop-9', v: 1 }], false, '形象修改', true);
    if (!res.state) {
        return;
    }
    user.P.add({Hp_Max:1})
    user.style_id = god.getRamdomStyle()
    let tpl = user.getMsgAttTpl();
    tpl.data.render_type = 'player_concise';
    user.sendMsg(tpl.template,tpl.data);

}